import { request } from "vendor/utils/T";
// import { toApi } from "@/service/proxyApi";
import { RequestDataType, RespDataType} from "./apiType";
export * from "./apiType";

const {get, download } = request;

// export const hdlApiDomain = "https://wind.dev.xiaoanshuju.com/hdl"
export const hdlApiDomain = "http://101.201.49.144"

/**
 * 获取图片分页列表
 */
export const getImageList = (params: RequestDataType.GetImageListParams) => {
    return get<RespDataType.ImageList>(`${hdlApiDomain}/snap/list`, params);

    // const items = [
    //     'https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp',
    //     'https://gw.alipayobjects.com/zos/antfincdn/cV16ZqzMjW/photo-1473091540282-9b846e7965e3.webp',
    //     'https://gw.alipayobjects.com/zos/antfincdn/x43I27A55%26/photo-1438109491414-7198515b166b.webp',
    //     "http://8.140.56.5:80/snap/load?path=oss/20230715/020138/img/1e38afaea95ac0d1ad87b50c91ababdb.png"
    // ];
    //
    // return mockRespData<RespDataType.ImageList>(new Array(1000).fill(0).map((_, index) => ({
    //     snapId: index.toString(),
    //     shopId: index.toString(),
    //     orderId: index.toString(),
    //     tableNum: index.toString(),
    //     status: "1",
    //     aiTime: "2023-07-15 14:14:00",
    //     potTime: index.toString(),
    //     settelTime: index.toString(),
    //     dishTime: index.toString(),
    //     base64Image: items[index % items.length],
    //     path: items[index % items.length],
    //     stImgFilePath: items[index % items.length],
    // })));
}

export const downloadImg = (url: string) => download(url)
